import { request } from './request.js'

export function getDetailData(iid){
  console.log(iid)
  return request({
    url:'/detail',
    params:{
      iid
    }
  })
}
export function getRecommend(){
  return request({
    url:'/recommend'
  })
}
export class goodsBaseInfo{
  constructor(itemInfo, columns, services) {
      this.title = itemInfo.title,
      this.desc = itemInfo.desc,
      this.newPrice = itemInfo.lowNowPrice,
      this.oldPrice = itemInfo.oldPrice||'',
      this.disCount = itemInfo.discountDesc||'',
      this.columns = columns,
      this.services = services
  }
}
export class goodsShopInfo{
  constructor(shopInfo){
    this.logo = shopInfo.shopLogo;
    this.name = shopInfo.name;
    this.fans = shopInfo.cFans;
    this.sells = shopInfo.cSells;
    this.score = shopInfo.score;
    this.goodsCount = shopInfo.cGoods
  }
}
export class goodsParamsInfo{
  constructor(info,rule){
    this.image = info.images ? info.images[0] : '';
    this.info = info.set;
    this.sizes = rule.tables
  }
}
